<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <!-- <meta name="viewport" content="width=device-width"> -->
        <title>新的表格导入</title>
        <link href="excel.css" rel="stylesheet">
    </head>
    <body onload="load()">
        <div id="x-spreadsheet" class="excel"></div>
        <script>
            function load(){
                x.spreadsheet('#x-spreadsheet')
                    .loadData({
                        view:{
                            width: 1000
                        },
                        freeze: 'C3',
                        styles: [
                            {
                                bgcolor: '#f4f5f8',
                                textwrap: true,
                                color: '#900b09',
                                border: {
                                    top: ['thin', '#0366d6'],
                                    bottom: ['thin', '#0366d6'],
                                    right: ['thin', '#0366d6'],
                                    left: ['thin', '#0366d6'],
                                },
                            },
							{
								bgcolor: '#ffff01',
							}
                        ],
						merges: [
							'C3:D4',
							'D12:I15'
						],
                        rows: {
                            1: {
                                cells: {
                                    0: { text: 'I' },
                                    2: { text: 'am' },
									4: { text: 'ReusKai' },
                                },
                            },
                            2: {
                                cells: {
                                    0: { text: 'render', style: 0 },
                                    1: { text: 'Hello' },
                                    2: { text: 'haha', merge: [1, 1] },
                                }
                            },
                            8: {
                                cells: {
                                    8: { text: 'border test', style: 0 },
                                }
                            },
							11: {
								cells: {
									3: {
										merge: [3, 5],
										style: 1,
									}
								}
							}
                        },
                    })
                .change((cdata) => console.log(cdata));
            }
        </script>
        <script type="text/javascript" src="excel.js"></script>
    </body>
</html>
